package com.infore.siteManagement.controller;


import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.infore.siteManagement.dao.IEntityManagerDao;
import com.infore.siteManagement.enums.ResultStatus;
import com.infore.siteManagement.util.ResultEntity;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@Controller
public class TestController {
    
    @Autowired
    private IEntityManagerDao iEntityManagerDao;
	
	private static final Logger logger = LoggerFactory.getLogger(TestController.class);
	
	@ApiOperation(value = "测试接口")
	@ApiImplicitParams({
		@ApiImplicitParam(name = "msg", value = "测试参数", paramType = "query", required = true, dataType = "String"),
	})
	@RequestMapping(value = "/test/msg", method = RequestMethod.GET )
	@ResponseBody
	public ResultEntity test(@RequestParam("msg")String msg) {
		ResultEntity resultEntity = new ResultEntity(ResultStatus.SUCCESS,"您输入的字符是：",msg);
		logger.info("1111111");
		List<Map<String, Object>> list = iEntityManagerDao.getListMapBySQL("SELECT station_id,STATION_NAME FROM STATION");
		return resultEntity.setDataList(list);
	}

}
